import { defineConfig } from "vite"
import uni from "@dcloudio/vite-plugin-uni"
import { visualizer } from "rollup-plugin-visualizer"

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [uni(), visualizer()],
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@import "uview-plus/theme.scss";`,// 全局引入 scss 变量
        silenceDeprecations: ['legacy-js-api', 'color-functions', 'import']
      }
    }
  },
  define: {
    'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV), // 注入环境变量
  }
})
